#!/usr/bin/env python

import wx

class Interactor(object):
    '''Interactor class
    
    @author Julot <andy.julot@gmail.com>
    @since Saturday, January 14, 2012. 08:33 AM'''
    
    def install(self, view, presenter):
        self.view = view
        self.presenter = presenter
        self.bind()
    
    def bind(self):
        view = self.view
        view.Bind(wx.EVT_ACTIVATE, self.onActivate)
        view.Bind(wx.EVT_CLOSE, self.onClose)
    
    def onActivate(self, event):
        self.presenter.onActivate(event.GetActive())
        event.Skip()
    
    def onClose(self, event):
        self.presenter.onClose()
        event.Skip()
